#Makefile for building and running the BS Crab Models model on a Linux or Mac OSX
EXEC=GCM
TPL=$(EXEC).tpl
DAT=$(EXEC).dat
FIL=GKCadak
OBJS=stats.cxx
ARG=

ifdef DEBUG
  ADMB=admb -s -g
else
  ADMB=admb 
endif


all: $(EXEC) 

$(EXEC): $(TPL) $(OBJS)
	$(ADMB) $(EXEC)

run: $(EXEC) $(EXEC).rep dust

$(EXEC).rep: $(TPL) $(OBJS) $(DAT) $(FIL).dat $(FIL).ctl
	./$(EXEC) -ind $(DAT) -nox $(ARG)

dust:
	rm -f *.eva *.log *.rpt *.htp *.r0* *.b0* *.p0* *.bar *.o admodel.* variance


clean:
	rm -f $(EXEC) *.eva *.log *.rpt *.htp *.cor *.par *.r* *.b* *.p*
	rm -f *.rep *.bar *.psv *.std $(EXEC).cpp admodel.* variance